home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************************\
- $VER: CNet PagerChat, v5.20 (15-Mar-98) by Dotoran!
- \**************************************************************************/
- options results;signal on SYNTAX;signal on ERROR;signal on IOERR
- a=sourceline(2);parse var a . ", "ver" ("vdate")" .;a=random(,,time("s"))
- tr=transmit;se=sendstring;gc=getchar;gu=getuser;pu=putuser
- parse source . . fp .;df=left(fp,max(lastpos('/',fp),lastpos(':',fp)))
-
- gu 15;access=result
- a=time("n");b=left(a,2)*60+substr(a,4,2);a=getclip("PagerWindow")
- if a>"" then if b>=a+5 then se "#0"df"PagerCleanUp}"
-
- /* check; check100; HiPort; */
- /* 3Port0 4Port0 3Ports 4Ports 3HiPort 4HiPort <-- CNet3/4.45 Specific */
- dat="2121864 2124654 2124264 2127054 2225094 2227884"
- bbsidentify bbs;a=word(result,3);cnet=(datatype(left(a,4),"n")=1&a>"4.44")+3
- guPORT0=word(dat,(cnet=4)+1) ; guPORTS=word(dat,(cnet=4)+3)
- guHIPORT=word(dat,(cnet=4)+5)
-
- call READCONFIG;call READGROUP;gu 1;handle=result;gu 3;name=result;gu 40;uid=result
- gu 27;cols=result;gu 7;time=result%10;gu 23;port=result;user=handle" ("name")"
- gu 2400088;max=result;gu 1500000;file="Out."left(result,3)
- gu 1100003;line=result+1;gu 2307386;epath=result /* Editor Temp Path (3.05c & 4.45) */
-
- call open(f1,df||file,"r")
- do line ; out=readln(f1) ; end
- call close(f1)
-
- if out="" then do
- call open(f1,df"Out.Def","r");out=readln(f1);call close(f1);end
-
- if out="" then out="not available for chatting."
-
- pn="He he his She she her"
-
- if multi=1 then do
-
- if cols<78 | gra=0 then do
- tr "f1n3cbCNet ceAmiga cbPagerc6, cf"ver"c6!n1"
- tr "z4ce Available SysOps z0n1"
- do i=1 to mtot
- tr "cb"right(i,2)"c6> ca"sys.i
- end i
- se "n1cfPage c6Which: cai64 2}" ; gu 70 ; a=result
- if a<1 | a>mtot then a=1
- end
-
- if cols>78 & gra=1 then do ; row=(20-mtot)%2
- tr "f1"row-2";30HcbCNet ceAmiga cbPagerc6, cf"ver"c6!ce"
- tr ""row";30Hz4 Available SysOps z0"
- do i=1 to mtot
- tr ""row+i";30Hz4 z0ca"center(sys.i,20)"z4 z0"
- end i
- tr ""row+i";30Hz4 z0"
- tr ""row+i+1";32HcdArrows ceSelect cfSysOpc6,"
- tr ""row+i+2";32HccENTER caCreates cbPagec6.s"
- r=1
- do until c2d(a)=13
- se ""row+r";32Hc9"center(sys.r,20)"u"
- gc ; a=result ; call CHECK
- if c2d(a)=27 then do 2 ; gc ; a=result ; end
- if a="A" | a="D" then do
- se ""row+r";32Hca"center(sys.r,20)
- r=r-1 ; if r=0 then r=mtot ; end
- if a="B" | a="C" then do
- se ""row+r";32Hca"center(sys.r,20)
- r=r+1 ; if r>mtot then r=1 ; end
- end ; a=r
- end
-
- end
-
- else a=1
-
- sysopname=sys.a ; ge=ge.a ; po=pos.a ; id=id.a ; if ge=0 then ge=2
- sysop=a;p1=subword(pn,ge*3-2,1);p2=subword(pn,ge*3-1,1)
- p3=subword(pn,ge*3,1) ; call PARSE(ac,31)
-
- if handle=sysopname & handle~="Dotoran" then do
- se "n2c6You want to caPAGE ceyourself cd"sysopname
- tr "c6? I c9don't c6think so..." ; exit ; end
-
- z=getclip("Pager"port)
- if z="" then do ; z=0 ; call setclip("Pager"port,z) ; end
-
- if find(it.0,access)=0 & z=cb+1 then do
- se "n2c6You've cfpaged cd"sysopname"c6 the c9maximum c6number "
- tr "of times! If "p2"'s around, "p2"'ll caanswerc6..." ; exit ; end
-
- tr "n2c6Enter A cbReason c6for Paging ca"sysopname"c6."
- gu 1100661 ; cancc=PRIV(0,14) /* Can user use "CC" command? */
-
- se "cf: cei144 35}s" ; gu 70 ; reason=result ; call CHECK
- if reason="" then do ; tr "uc9Abort" ; exit ; end
-
- if getclip("PagerWindow")~="" then do
- se "n1c6A cbPager ceWindow c6is already c9active c6on cd"
- tr sysopname"'s c6screen." ; exit ; end
-
- gu 12 ; date=result
- if cc=1 & cancc=1 then do
- gu guHIPORT ; aa=result
- online=-1 ; call PARSE(pos.a,aa)
- do i=1 to words(it.0) ; getportid word(it.0,i) ; aa=result
- if aa=-1 | aa~=id then iterate i
- if aa=id then do ; online=word(it.0,i) ; leave i ; end
- end i
- if online>-1 then do
- se "n1cd"sysopname" c6is caalready c6signed onto cfPort "
- tr online"c6! Sending a ceChat Request c6now..."
- addkeys ("CC"online"!`"reason"`") ; exit ; end
- end
-
- setobject reason ; pu 1307274 /* Current Chat Message (3.05c & 4.45) */
- gu 1100729 ; page=result /* May Page The SysOp Priv. (3.05c & 4.45) */
-
- gu guPORT0+port*24 /* check; */
- CanChat=BitTST(d2c(result),4) /* Checkmark next to "Sysop is in"? */
-
- gu guPORTS /* check Global Ports setting */
- CanChatALL=BitTST(d2c(result),4) /* Checkmark next to "Sysop is in" Globally? */
-
- if page=2 | (page=0 & (CanChat=1 | CanChatALL=1)) then do
- paged=1 ; call CHATLOG
- call open(f1,"ram:chat."port,"W")
- call writeln(f1,uid)
- call writeln(f1,user)
- call writeln(f1,reason)
- call writeln(f1,sysopname)
- call writeln(f1,time)
- call writeln(f1,sysop)
- call close(f1)
- se "n1c6Now c9Paging ca"sysopname"c6....n1"
- address command "run >nil: rx "df"Pager "port" "cnet
- aa="º ºC³ ³"
-
- if gra=0 then tr "n1cfPaging cb"sysopname"cf..."
-
- if cols>78 & gra=1 then do ; gu 12 ; date=result
- date=translate("HIJ. EF, LMNO (QRSTUVm)",date,"ABCDEFGHIJKLMNOPQRSTUV")
- if substr(date,21,1)=" " then date=delstr(date,21,2)
- if substr(date,16,1)=" " then date=delstr(date,16,1)
- tr "f1n1"center("cdA window similar to this one appeared on ce"sysopname"'s cdscreen:",88)
- tr "ccÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍce¿ "
- tr "ccºCcfCNet Amiga Pager, "ver" Written by Dotoran!CceÀÄ´"
- tr "ccº ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍce¿ ³"
- tr "ccº ºCcbPagec9: cd"left(date" c6for cb"sysopname,61)" ce³ ³"
- tr "ccº ºCce³ ³"
- tr "ccº ºCcbUserc9: ca"left(handle" cf(ce"name"cf) c6Port ca"port,71)"ce³ ³"
- tr "ccº ºCce³ ³"
- tr "ccº ºCcbReasonc9: cf`cd"left(reason"cf'",58)"ce³ ³"
- tr "ccº ÓceÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³"
- tr "ccº ÉÍÍÍÍce¿ ccÉÍÍÍce¿ ccÉÍÍÍÍÍce¿ ccÉÍÍÍÍÍÍÍÍÍce¿ ccÉÍÍÍÍÍÍÍÍÍce¿ ccÉÍÍÍÍÍÍÍÍÍÍÍce¿ ccÉÍÍÍÍce¿ ccÉÍÍÍÍÍÍce¿ ³"
- tr "ccº ºcfChatce³ ccºcfOLMce³ ccºcfFSendce³ ccºcfTerminatece³ ccºcfGone In 5ce³ ccºcfUnavailablece³ ccºcfBusyce³ ccºcfo1Ignoreo0ce³ ³"
- tr "ccº ÓceÍÄÄÄÙ ccÓceÍÄÄÙ ccÓceÍÄÄÄÄÙ ccÓceÍÄÄÄÄÄÄÄÄÙ ccÓceÍÄÄÄÄÄÄÄÄÙ ccÓceÍÄÄÄÄÄÄÄÄÄÄÙ ccÓceÍÄÄÄÙ ccÓceÄÄÄÄÄÄÙ ³"
- tr "ccÓceÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"
- tr " cdIf "p2" should press an underlined button, you'll receive an cbOLM cdMessage!"
- end
-
- if cols<78 | gra=0 then do
- tr "n1ca"sysopname" c6has been notified that you wish to chat. "
- tr "n1"p1" ceMay c6or ceMay c9NOT c6be around."
- tr "n1"p1" will cdAnswer c6if "p2" is available."
- tr "n1cbONE c9Page c6is caENOUGHc6."
- se "n1A window telling ca"sysopname"c6 that someone has "
- tr "c9Paged c6stays on "p3" screen."
- end
-
- end
-
- else do
- se "n1c9Sorryc6, ca"sysopname" c6isn't around right now.n2"
- if sysop=1 then tr p1"'s "out"n1"
- se "c6Leave cbMail c6for ca"sysopname
- se "c6? c7[caYesc7]c6: ca" ; gc ; z=result
- if z="N" then do ; tr "No." ; paged=0 ; call CHATLOG ; exit ; end
- tr "Yes!" ; setmailsubj strip(left(reason,30)) ; cleareditor
- paged=2 ; call CHATLOG ; tr "n1c6Mail Subjectc9: ca"left(reason,30)
- calleditor 0 ; gu 1109865 ; st=result /* edbuff status (3.05c & 4.45) */
- if st=1 then call PARSE(mid.a,max)
- if words(it.0)=1 & st=1 then do
- setobject "" ; pu 1307274 /* Current Chat Message. (3.05c & 4.45) */
- se "cbSaving c6Mail..." ; writemail id ; tr "cdDonec6!" ; exit ; end
- if st=0 then do
- tr "c9Empty Editor" ; exit ; end
- if st=-1 then do ; tr "c9Aborted Editor" ; exit ; end
- line.0="caUser c6initially cfpagedc9: cd"sys.a"n1"
- lin.0 ="n1c6This camessage c6sent toc9:cbn1"
- do i=1 to words(it.0)
- id=word(it.0,i) ; loadscratch id ; savescratch (-id)
- getscratch 1 ; han=result ; lin.i=">5cd"han
- end i
- call open(f1,epath"_edbuff"port,"r")
- do i=1 until eof(f1) ; line.i=readln(f1) ; end i
- call close(f1)
- call open(f1,epath"_edbuff"port,"w")
- do j=0 to i-1 ; call writeln(f1,line.j) ; end j
- do i=0 to words(it.0) ; call writeln(f1,lin.i) ; end i
- call close(f1)
- address command "copy "epath"_edbuff"port" "epath"_edbuf"port
- do i=1 to words(it.0)
- id=word(it.0,i) ; loadscratch id ; savescratch (-id)
- getscratch 1 ; han=result ; se "cbSending c6to...ca"han"c6..."
- setmailsubj strip(left(reason,30)) ; writemail id
- address command "copy "epath"_edbuf"port" "epath"_edbuff"port
- tr "cdSentc6!"
- end i ; setobject "" ; pu 1307274 /* Chat Message. (3.05c & 4.45) */
- address command "delete "epath"_edbuf"port
- end
-
- exit
-
- READCONFIG:
- call open(f1,df"PagerConfigF","r")
- a=readln(f1);parse var a gra"|"cc"|"cb"|"ac"|"hr"|"j
- a=readln(f1);parse var a fpath"|"cost"|"kill"|"j
- a=readln(f1);parse var a chsp"|"chvo"|"j
- a=readln(f1);parse var a font"|"size"|"logN"|"logK"|"j
- a=readln(f1);parse var a mtot"|"grp1"|"sys1"|"grp2"|"sys2"|",
- grp3"|"sys3"|"grp4"|"sys4"|"j
- do i=1 to mtot;sysop.i=readln(f1);end i;if mtot>1 then multi=1
- call close(f1)
- return
-
- READGROUP:
- call PARSE(grp1,31);if find(it.0,access)>0 then do
- call PARSE(sys1,mtot);signal GETSYSOPS;end
- call PARSE(grp2,31);if find(it.0,access)>0 then do
- call PARSE(sys2,mtot);signal GETSYSOPS;end
- call PARSE(grp3,31);if find(it.0,access)>0 then do
- call PARSE(sys3,mtot);signal GETSYSOPS;end
- call PARSE(grp4,31);if find(it.0,access)>0 then do
- call PARSE(sys4,mtot);signal GETSYSOPS;end
-
- GETSYSOPS:
- do i=1 to c;a=it.i
- parse var sysop.a id.i"|"sys.i"|"ge.i"|"mid.i"|"pos.i"|"snd.i"|",
- say.i"|"j
- end i;mtot=c
- return
-
- CHATLOG:
- call open(f1,"sysdata:log/"logN||id,substr("wa",exists("sysdata:log/"logN||id)+1,1))
- call writeln(f1,"ca"left(handle,25)"cd"date()" cb"left(reason,39)"ce"substr("NYM",paged+1,1))
- call close(f1);return
-
- PARSE:;it.="";c=0;it=translate(arg(1)," ",".,")
- do z=1 to words(it);c=c+1;it.c=word(it,z)
- if index(it.c,"-")>0 then do;parse var it.c x"-"y
- if y="" then y=arg(2);if x="" then x=0;if x>y then do;d=x;x=y;y=d;end
- do b=x to y;it.c=b;c=c+1;end;c=c-1;end
- else if it.c>arg(2) | it.c<0 then do;c=c-1;iterate;end;end
- do i=1 to c;it.0=it.0||it.i" ";end;return c
-
- PRIV:;gu 1400660+(44*Arg(1));aa=reverse(d2c(result,4));do i=2 to Arg()
- if ~BitTST(aa,Arg(i)) then return 0;end i;return 1
-
- CHECK:;if ARG() & ARG(1)~="###PANIC" then return ARG(1)
- getcarrier;if result="TRUE" then if ARG() then return ARG(1);else return
- logentry "Lost Carrier!!";bufferflush;exit
- SYNTAX:;ERROR:;IOERR:;e1="n1 Error: "rc" ("errortext(rc)")"
- e2=" Line: "left(sigl,4)"File:";c="`"fp", "ver"'";e2=e2" "c;tr e1;tr e2
- logentry e1;logentry e2;e=strip(translate(sourceline(sigl),"\{",""))
- do while e~="";e3="Source: "left(e,37);tr e3;logentry e3;e=substr(e,38);end
- bufferflush
- /**************************************************************************\
- \****************************************** Frontiers BBS (716)/823-9892 **/
-